<template>
  <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage3"
      :page-size="pageSize"
      layout="prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: ["total", "pageSize"],
  data() {
    return {
      currentPage3: 1,
    };
  },

  mounted() {},

  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.$parent.pageSize = val;
      this.$parent.getData();
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.$parent.page = val;
      this.$parent.getData();
    },
  },
};
</script>

<style lang="less" scoped>
/deep/.btn-prev,
/deep/.number,
/deep/.btn-next,
/deep/.el-input__inner {
  width: 30px !important;
  height: 30px;
  border: 2px solid #525252 !important;
  border-radius: 50%;
  box-sizing: border-box !important;
  padding: 0 !important;
  min-width: 0 !important;
}
/deep/.number {
  margin-left: 5px;
}
/deep/.number:last-child {
  margin-right: 5px;
}
.el-pagination {
  text-align: right;
  margin-right: 50px;
}
.block {
  padding-bottom: 30px;
}
</style>